 /**
  ********************************************
  Node Class
  ********************************************
  
 * This program uses "Node" in conjucation with "LinkedList" to complete Homework 3
 * 
 * This class comes with a "remove" method on top of what was already here
 * 
 * @author (Greg Shevach & Chris Nerf) 
 * @version (v1.01)
 * @date (9/27/11)
 */

public class Node<T> {

    private T data;
    private Node<T> next;

    public Node() {
	data = null;
	next = null;
    }

    public Node( T element ) {
	data = element;
	next = null;
    }

    public Node<T> getNext() {
	return ( next );
    }

    public void setNext( Node<T> node ) {
	next = node;
    }

    public T getElement() {
	return ( data );
    }

    public void setElement( T element ) {
	data = element;
    }

    public String toString() {
	String s = new String();

	s += "data: " + data.toString();
	s += "next: " + next;

	return ( s );
    }
    
    public void remove(T element) {  //Sets the element equal to null
    data = element;
    data = null;
  }
}

